﻿#include "ssSpher.h"


namespace StarSeeker
{

ssSpher::ssSpher(void)
{
	Zero();
}

ssSpher::ssSpher(ssfloat x, ssfloat y, ssfloat z, ssfloat radius)
{
	Set(x, y, z, radius);
}

void ssSpher::Set(ssfloat x, ssfloat y, ssfloat z, ssfloat radius)
{
	m_center.Set(x, y, z);
	m_radius = radius;
}

void ssSpher::Zero()
{
	m_center.Zero();
	m_radius = 0.0f;
}

bool ssSpher::PointIsInside(ssfloat x, ssfloat y, ssfloat z)
{
	ssVector3 p(x,y,z);
	return PointIsInside(p);
}

bool ssSpher::PointIsInside(ssVector3& p)
{
	return (p - m_center).SquaredLength() < m_radius*m_radius;
}

}
